package com.liu.controller;//

import com.liu.entity.ClearGoods;
import com.liu.service.intf.ClearGoodsService;
import com.liu.vo.PageBeanJson;
import com.liu.vo.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//                       .::::.
//                     .::::::::.
//                    :::::::::::
//                 ..:::::::::::'
//              '::::::::::::'
//                .::::::::::
//           '::::::::::::::..
//                ..::::::::::::.
//              ``::::::::::::::::
//               ::::``:::::::::'        .:::.
//              ::::'   ':::::'       .::::::::.
//            .::::'      ::::     .:::::::'::::.
//           .:::'       :::::  .:::::::::' ':::::.
//          .::'        :::::.:::::::::'      ':::::.
//         .::'         ::::::::::::::'         ``::::.
//     ...:::           ::::::::::::'              ``::.
//    ```` ':.          ':::::::::'                  ::::..
//                       '.:::::'                    ':'````..
@RestController
@RequestMapping("/api/cleargoods/")
public class CGoodsController {
    @Autowired
    private ClearGoodsService service;
    @RequestMapping("insert.do")
    public R insert(ClearGoods clearGoods){
        System.out.println(clearGoods);
        return service.othersInsert(clearGoods);
    }
    @RequestMapping("selectAll.do")
    public PageBeanJson selectAll(int page, int limit){
        return service.pageQuery(page,limit);
    }
    @RequestMapping("name_select.do")
    public PageBeanJson selectByName(String name,int size,int limit){
        return service.NameQuery(name,size,limit);
    }
    @RequestMapping("delete.do")
    public R delete(int id){
        return service.othersDelete(id);
    }
    @RequestMapping("update.do")
    public R update(int id){
        return service.ohtersUpdate(id);
    }
    @RequestMapping("part_delete.do")
    public R partDelete(@RequestBody int[] ids){
        return service.partDelete(ids);
    }
}
